<template>
  <div class="mineInformationBox">
    <header-box title="收货地址管理" :showLeft="true" :showRight="true"></header-box>
    <div class="cellBox">
      <router-link
        :to="{name:'editAddress',query:{id: item.id}}"
        v-for="(item,index) in addressList"
        :key="index"
        class="cell flex"
      >
        <div class="contBox">
          <div class="user flex">
            <p>{{item.name}}</p>
            <p class="phone">{{item.phone}}</p>
          </div>
          <div class="address clearfix">
            <span v-if="item.default" class="default">[默认]</span>
            <span>{{item.address}}</span>
          </div>
        </div>
        <div class="rightBox flex">
          <x-icon type="ios-arrow-right" size="24" class="iconBox" />
        </div>
      </router-link>
    </div>
    <div class="addAddress">
      <router-link to="editAddress" class="footerBox" @click="outShow=true">添加新的收货地址</router-link>
    </div>
  </div>
</template>

<script>
import HeaderBox from '@/components/header'

export default {
  components: {
    HeaderBox
  },
  data() {
    return {
      addressList: [
        {
          id: '1',
          name: '刘亮',
          phone: '13812311212',
          default: true,
          address: '北京海淀区知春路盈都大厦C座3单元18C'
        },
        {
          id: '2',
          name: '张杰',
          phone: '13812311212',
          default: false,
          address: '北京海淀区知春路盈都大厦C座3单元18C'
        }
      ]
    }
  },

  methods: {}
}
</script>

<style lang="less" scoped>
.mineInformationBox {
  .cellBox {
    background-color: #fff;
    padding: 0 20px;
    .cell {
      padding: 20px 0;
      border-bottom: 1px solid #eee;
      position: relative;
      color: currentColor;
      min-height: 60px;
      &:last-child {
        border-bottom: none;
      }
      .contBox {
        .user {
          font-size: 34px;
          .phone {
            margin-left: 50px;
          }
        }
        .address {
          font-size: 30px;
          .default {
            color: #f6c243;
          }
          span {
            color: #999999;
          }
        }
      }
      .rightBox {
        margin-left: auto;
        .iconBox {
          fill: #666;
        }
      }
    }
  }
  .addAddress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    border-top: 1px solid #dcdcdc;
    .footerBox {
      display: block;
      height: 90px;
      line-height: 90px;
      text-align: center;
      background-color: #f60;
      color: #fff;
      border-radius: 20px;
      font-size: 30px;
    }
  }
}
</style>